cmake_minimum_required(VERSION 2.8.3)
project(getmap)
set(CMAKE_CXX_STANDARD 11)

find_package(catkin REQUIRED
        COMPONENTS
            roscpp
            rospy
            nav_msgs
            tf2
            std_msgs
        )

find_package(Bullet REQUIRED)
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)

find_package(PkgConfig REQUIRED)
pkg_check_modules(YAMLCPP yaml-cpp REQUIRED)
if(YAMLCPP_VERSION VERSION_GREATER "0.5.0")
    add_definitions(-DHAVE_YAMLCPP_GT_0_5_0)
endif()
link_directories(${YAMLCPP_LIBRARY_DIRS})

catkin_package(
    INCLUDE_DIRS
        #include
    #LIBRARIES
     #   map_server_image_loader
    CATKIN_DEPENDS
        roscpp
        rospy
        std_msgs
        nav_msgs
        tf2
)

include_directories(
    include
    ${BULLET_INCLUDE_DIRS}
    ${catkin_INCLUDE_DIRS}
    ${SDL_INCLUDE_DIR}
    ${SDL_IMAGE_INCLUDE_DIRS}
    ${YAMLCPP_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
)

add_executable(getmap src/getmap.cpp)
add_dependencies(getmap ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

#set_target_properties(map_server-map_saver PROPERTIES OUTPUT_NAME map_saver)
target_link_libraries(getmap
    ${catkin_LIBRARIES}
    /usr/local/lib/libalibabacloud-oss-cpp-sdk.a
    /usr/lib/x86_64-linux-gnu/libcrypto.so
    /usr/lib/x86_64-linux-gnu/libcurl.so
    /usr/lib/x86_64-linux-gnu/libpthread.so
    /usr/lib/x86_64-linux-gnu/libssl.so
)

catkin_install_python(PROGRAMS scripts/upmap.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## Install executables and/or libraries
#install(TARGETS map_server-map_saver map_server
  #RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

## Install project namespaced headers
#install(DIRECTORY include/${PROJECT_NAME}/
 # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  #FILES_MATCHING PATTERN "*.h"
  #PATTERN ".svn" EXCLUDE)

